<%-- 
    Document   : Other
    Created on : Jun 10, 2013, 9:19:14 PM
    Author     : Acer
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>Other page</title>
    </head>
    <body>
        
        <%!
        int count;
        public void jspInit(){
            ServletConfig sc = getServletConfig();
            count = Integer.parseInt(sc.getInitParameter("count"));
            System.out.println("In jspInit");
            }
        %>

        <%
        out.println("<h1>Using page, session, out, config, and application Implicit objects</h1>");
        %>
        Count value without using config implicit object:<b><%=count%></b><br/>

        <%
        this.log("log message");
        ((HttpServlet)page).log("anotherMessage");
        ServletContext ct = config.getServletContext();
        out.println("Value of sessionVar is:&nbsp;&nbsp;<b>"+session.getAttribute("sessionVar")+"</b><br/>");
        out.println("Server name and version using implicit object:&nbsp;&nbsp;<b>"+ct.getServerInfo()+"</b><br/>");
        out.println("Value of context parameter param1 obtained using application implicit object:&nbsp;&nbsp;<b>"+application.getInitParameter("param1")+"</b><br/>");
        out.println("Count value retrieved using config implicit object:&nbsp;&nbsp;<b>"+config.getInitParameter("count")+"</b>");
        %>

    </body>
</html>
